<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="primus" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fc" tagdir="/WEB-INF/tags/form" %>
<%@ taglib prefix="btn" tagdir="/WEB-INF/tags/btn" %>
<%@ taglib prefix="javatime" uri="http://sargue.net/jsptags/time" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/fmt" %>
<primus:page title="降价拍促销列表">
    <jsp:body>
        <div class="breadcrumbs ace-save-state" id="breadcrumbs">
            <ul class="breadcrumb">
                <li>
                    <i class="ace-icon fa fa-home home-icon"></i>
                    <a href="welcome.do">
                        首页
                    </a>
                </li>
                <li class="active">
                    降价拍
                </li>
            </ul>
        </div>

        <div class="page-content">
            <div class="row">
                <div class="col-xs-12">
                    <!-- PAGE CONTENT BEGINS -->
                    <div class="row">
                        <div class="col-xs-12">
                            <h3 class="header smaller lighter blue">
                                降价拍 <span class="inline help-block"></span>
                                <span class="hidden-sm hidden-xs btn-group pull-right">
                                    <a href="management/specialOffer/new.do"
                                       class="btn btn-sm btn-primary"><i
                                            class="ace-icon glyphicon glyphicon-plus"></i>
                                        添加
                                    </a>
                                </span>
                            </h3>
                            <table id="cat-table" class="table table-hover">
                                <thead>
                                <tr>
                                    <th class="name">名称</th>
                                    <th>开始时间</th>
                                    <th>结束时间</th>
                                    <th>创建时间</th>
                                    <th class="center operate">操作</th>
                                </tr>
                                </thead>

                                <tbody>
                                <c:forEach items="${page.content}" var="item">
                                    <tr>
                                        <td><c:out value="${item.name}" /></td>
                                        <td><c:out value="${item.startTime}" /></td>
                                        <td><c:out value="${item.endTime}" /></td>
                                        <td><fmt:formatDate value="${item.createTimestamp}" pattern="yyyy-M-d HH:mm:ss" /></td>
                                        <td>
                                            <div class="hidden-sm hidden-xs btn-group">
                                                <a href="management/cutPriceSalePromotion/edit.do?id=<c:out value='${item.id}'/> " class="btn btn-minier btn-info">
                                                    <i class="ace-icon fa fa-pencil bigger-120"></i>
                                                </a>
                                                <c:choose>
                                                    <c:when test="${item.commonStatus.name() == 'ENABLE'}">
                                                        <a href="management/cutPriceSalePromotion/statusToggle.do?id=<c:out value='${item.id}'/> " class="btn btn-minier btn-danger">
                                                            <i class="ace-icon fa fa-ban bigger-120"></i>
                                                        </a>
                                                    </c:when>
                                                    <c:otherwise>
                                                        <a href="management/cutPriceSalePromotion/statusToggle.do?id=<c:out value='${item.id}'/> " class="btn btn-minier btn-success">
                                                            <i class="ace-icon fa fa-check bigger-120"></i>
                                                        </a>
                                                    </c:otherwise>
                                                </c:choose>
                                            </div>
                                        </td>
                                    </tr>
                                </c:forEach>
                                <%--<c:forEach items="${pages.content}" var="item">--%>
                                    <%--<tr id="tr-${item.id}">--%>
                                        <%--<td><c:out value="${item.id}"/></td>--%>
                                        <%--<td><c:out value="${item.name}"/></td>--%>
                                        <%--<td>--%>
                                            <%--<c:out value="${empty item.status?'':--%>
                                            <%--item.status}"/>--%>
                                        <%--</td>--%>
                                        <%--<td><c:out value="${item.idx}"/></td>--%>
                                        <%--<td>--%>
                                            <%--<fmt:formatDate value="${item.createTimeStamp}"--%>
                                                            <%--pattern="yyyy-MM-dd HH:mm:ss"/>--%>
                                        <%--</td>--%>
                                        <%--<td>--%>
                                            <%--<div class="hidden-sm hidden-xs btn-group">--%>
                                                <%--<a href="management/category/<c:out value='${item.id}'/> "--%>
                                                   <%--class="btn btn-minier btn-info">--%>
                                                    <%--<i class="ace-icon fa fa-pencil bigger-120"></i>--%>
                                                <%--</a>--%>
                                            <%--</div>--%>
                                        <%--</td>--%>
                                    <%--</tr>--%>
                                <%--</c:forEach>--%>
                                </tbody>
                            </table>

                            <primus:springPagePagination url="management/cutPriceSalePromotion/list" springPage="${pages}"/>

                        </div><!-- /.span -->
                    </div><!-- /.row -->
                    <!-- PAGE CONTENT ENDS -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </div>
    </jsp:body>
</primus:page>